package com.juzishuke.margin.s1.controller;

import com.juzishuke.margin.base.api.bill.MarginRepayPlanApi;
import com.juzishuke.margin.base.dto.bill.req.RepayPlanSearchReq;
import com.juzishuke.margin.base.dto.bill.res.RepayPlanDTO;
import com.juzishuke.margin.common.response.MarginResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : libo@juzishuke.com
 * @Title :
 * @Description :
 * @date : 2024/4/9 16:33
 * @since :1.0
 */
@Slf4j
@RestController
public class MarginBaseController {
    
    @Autowired
    private MarginRepayPlanApi marginRepayPlanApi;
    
    @GetMapping("abc")
    public MarginResponse abc() {
        RepayPlanSearchReq repayPlanSearchReq = new RepayPlanSearchReq();
        repayPlanSearchReq.setOrderId("123");
        repayPlanSearchReq.setBillCode("NET");
        MarginResponse<List<RepayPlanDTO>> netRepayPlansResponse = marginRepayPlanApi.getRepayPlan(repayPlanSearchReq);
        return netRepayPlansResponse;
    }
    @PostMapping("/{a}/{b}/{c}/{d}")
    public String all() {
        log.info("abc");
        return "{\"channel\":\"6174\",\"json\":\"XFMoKHZAW2lgpTRA7z43i6OYcth5pu+GCs3h3wiv4ANLjGqf8qROtmhVa2lLqciEBvlKT5p4gLkzkxhbcq8EKheEFqa8XBhqFYHENkoWSnAaanjujitTYBAxUacypN459YlJZItDeF/sRuewnvP/dC+sBDsXGp6+XwMRQ0MhZ2+x4aX2BLXAoB78/iyTkq0KYza7aAKmgjhjMwnYFDrfSYhWrtFg8dxKDcl3I3H0nx4=\",\"key\":\"1\",\"sign\":\"tLl3lQnBSOacaEydEDQZoqvU9YbUoiJaxK9t+xOfyrO65DPsNmjO37LYfB4yVrd+\"}";
    }
}
